home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_gen_elevswitch3.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
2KB
|
79 lines
# Jones 3D Cog Script
#
# gen_ElevSwitch3.cog
#
# This elevator will go up to frame one, sleep, then come back down to frame 0 when
# entered from the bottom. When entered from the top, it should stay at the bottom.
# The button surface is a call switch you can put at the top to call the thing up there.
# Elevator will react to "blocked" message.
#
# [DS/IS/JS]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
# ========================================================================================
symbols
message crossed
message activate
message arrived
message timer
surface lower_adjoin0 linkid=1
surface lower_adjoin1 linkid=1
surface lower_adjoin2 linkid=1
surface button linkid=1
thing elevator desc=elevator_object
flex start_wait=0.25 desc=pause_before_moving_up
flex sleeptime=2.0
flex speed=4.0
# sound wav0=beep1.wav
end
# ========================================================================================
code
crossed: // If player crosses adjoin(s)
Sleep(start_wait); // pause before moving up
// fall through
# ........................................................................................
activate: // If player presses button
if (GetSenderId() != 1) return;
if (GetWallCel(button) == 1) return;
SetWallCel(button, 1);
// PlaySoundPos(wav0, GetSurfaceCenter(button), 1, -1, -1, 0);
MoveToFrame(elevator, 1, speed);
return;
# ........................................................................................
arrived:
if (GetCurFrame(elevator) == 0)
{
SetWallCel(button, 0);
// PlaySoundPos(wav0, GetSurfaceCenter(button), 0.75, -1, -1, 0);
}
else
{
// Set sleep time at top
SetTimer(sleeptime);
}
return;
# ........................................................................................
timer:
// Send elevator down
MoveToFrame(elevator, 0, speed);
return;
end